<?php

/**
 * UsuarioGarantia form base class.
 *
 * @package    form
 * @subpackage usuario_garantia
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseUsuarioGarantiaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_usuario_garantia' => new sfWidgetFormInputHidden(),
      'tp_garantia'         => new sfWidgetFormInput(),
      'no_primeiro_fiador'  => new sfWidgetFormInput(),
      'no_segundo_fiador'   => new sfWidgetFormInput(),
      'no_primeiro_conjuge' => new sfWidgetFormInput(),
      'no_segundo_conjuge'  => new sfWidgetFormInput(),
      'id_dados_usuario'    => new sfWidgetFormDoctrineChoice(array('model' => 'DadosUsuario', 'add_empty' => false)),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_usuario_garantia' => new sfValidatorDoctrineChoice(array('model' => 'UsuarioGarantia', 'column' => 'id_usuario_garantia', 'required' => false)),
      'tp_garantia'         => new sfValidatorString(array('max_length' => 1)),
      'no_primeiro_fiador'  => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'no_segundo_fiador'   => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'no_primeiro_conjuge' => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'no_segundo_conjuge'  => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'id_dados_usuario'    => new sfValidatorDoctrineChoice(array('model' => 'DadosUsuario')),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('usuario_garantia[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'UsuarioGarantia';
  }

}
